using Aop.Api.Util;
using Vin.Tool.Core.NetCategory;

namespace Vin.Extension.Framework.Alipay.Service;

public class VinAlipaySignatureService : VinAlipayBaseService
{
    // public bool PaySignatureCertVerifyV2Async(string charset = "UTF-8", string signType = "RSA2")
    // {
    //     var formDict = HttpContext.FormDictionary();
    //     return AlipaySignature.RSACertCheckV1(formDict, AlipayConfig.AlipayPublicCertPath, charset, signType);
    // }
    public bool PaySignatureCertVerifyV2Async(string? charset = null, string? signType = null)
    {
        charset ??= AlipayConfig.Charset ?? "UTF-8";
        signType ??= AlipayConfig.SignType ?? "RSA2";
        var formDict = HttpContext.FormDictionary();
        return AlipaySignature.RSACertCheckV1(formDict, AlipayConfig.AlipayPublicCertPath, charset, signType);
    }
}